<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>
            <?php echo ($title); ?>
        </title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
        <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="format-detection" content="telephone=no">
        <link rel="stylesheet" href="/task/laybbs/Public/css/x-admin.css" media="all">
        <script src="/task/laybbs/Public/jquery-3.1.1.min.js" charset="utf-8"></script>
        <script src="/task/laybbs/Public/lib/layui/layui.js" charset="utf-8"></script>
        <script src="/task/laybbs/Public/js/x-layui.js" charset="utf-8"></script>
        <script src="/task/laybbs/Public/js/x-admin.js"></script>
    </head>
    <body>
    <div class="x-nav">
        <span class="layui-breadcrumb">
          <a><cite>首页</cite></a>
          <a><cite>会员管理</cite></a>
          <a><cite>基本设置</cite></a>
        </span>
        <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"  href="javascript:location.replace(location.href);" title="刷新"><i class="layui-icon" style="line-height:30px">ဂ</i></a>
    </div>
    <div class="x-body">
        <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
          <ul class="layui-tab-title">
            <li class="layui-this">网站设置</li>
            <li>邮件设置</li>
            <li>关闭网站</li>
          </ul>
          <div class="layui-tab-content" >
            <div class="layui-tab-item layui-show">
                <form class="layui-form layui-form-pane" action="">
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class='x-red'>*</span>网站名称
                        </label>
                        <div class="layui-input-block">
                            
                            <input type="text" name="title" autocomplete="off" placeholder="控制在25个字、50个字节以内" class="layui-input" value="<?php echo ($info['title']); ?>">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class='x-red'>*</span>描述
                        </label>
                        <div class="layui-input-block">
                            
                            <input type="text" name="description" autocomplete="off" placeholder="空制在80个汉字，160个字符以内" class="layui-input" value="<?php echo ($info['description']); ?>">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class='x-red'>*</span>底部版权信息
                        </label>
                        <div class="layui-input-block">
                            
                            <input type="text" name="copyright" autocomplete="off" placeholder="&copy; 2016 X-admin"
                            class="layui-input" value="<?php echo ($info['copyright']); ?>">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <button class="layui-btn" lay-submit="" lay-filter="web-info">
                            保存
                        </button>
                    </div>
                </form>
                <div style="height:100px;"></div>
            </div>
            <div class="layui-tab-item">
                 <form class="layui-form layui-form-pane" action="">
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class='x-red'>*</span>SMTP服务器
                        </label>
                        <div class="layui-input-block">
                            
                            <input type="text" name="smtp_host" autocomplete="off" placeholder="smtp.qq.com" class="layui-input" value="<?php echo ($info['smtp_host']); ?>">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class='x-red'>*</span>SMTP 端口
                        </label>
                        <div class="layui-input-block">
                            
                            <input type="text" name="smtp_port" autocomplete="off" placeholder="25"
                            class="layui-input" value="<?php echo ($info['smtp_port']); ?>">
                        </div>
                    </div>
                     <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class='x-red'>*</span>邮箱帐号
                        </label>
                        <div class="layui-input-block">
                            
                            <input type="text" name="smtp_user" autocomplete="off" placeholder="邮件服务商申请的帐号"
                            class="layui-input" value="<?php echo ($info['smtp_user']); ?>">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">
                            <span class='x-red'>*</span>邮箱密码
                        </label>
                        <div class="layui-input-block">
                            
                            <input type="text" name="smtp_pw" autocomplete="off" placeholder="邮件服务商申请的密码"
                            class="layui-input" value="<?php echo ($info['smtp_pw']); ?>">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <button class="layui-btn" lay-submit="" lay-filter="smtp">
                            保存
                        </button>
                    </div>
                </form>
            </div>
            <div class="layui-tab-item">
                <form class="layui-form">
                    <div class="layui-form-item">
                        <label for="AppId" class="layui-form-label">
                            <span class="x-red">*</span>是否开启
                        </label>
                        <div class="layui-input-block">
                          <input type="checkbox"
                          <?php if ($info['web_close']): ?>
                              checked=""
                              value="1"
                          <?php endif ?>
                          name="open" lay-skin="switch" lay-filter="switch-web-close" title="开关">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label for="L_repass" class="layui-form-label">
                        </label>
                        <button class="layui-btn" lay-filter="web-close" lay-submit="">
                            保存
                        </button>
                    </div>
                </form>
            </div>
          </div>
        </div> 
    </div>
    <script>
        layui.use(['element','layer','form'], function(){
            $ = layui.jquery;//jquery
          lement = layui.element();//面包导航
          layer = layui.layer;//弹出层
          form = layui.form()
        
         //监听提交(web-info)
          form.on('submit(web-info)', function(data){
            console.log(data.field);
            data.field.type = 'webInfo';
            //发异步，把数据提交给php
            $.post('<?php echo U('admin/system/sys_set');?>', {data: data.field}, function(response) {
                if (response.type == 1) {
                    layer.alert(response.info, {icon: 6},function () {
                        window.location.reload();
                    });
                } else if(response.type == 0) {
                    layer.msg(response.info, {icon: 5});
                }
            });
            return false;
          });

          //监听提交(smtp)
          form.on('submit(smtp)', function(data){
            console.log(data.field);
            data.field.type = 'smtp';
            //发异步，把数据提交给php
            $.post('<?php echo U('admin/system/sys_set');?>', {data: data.field}, function(response) {
                if (response.type == 1) {
                    layer.alert(response.info, {icon: 6},function () {
                        window.location.reload();
                    });
                } else if(response.type == 0) {
                    layer.msg(response.info, {icon: 5});
                }
            });
            return false;
          });

          //监听提交(web-close)
          form.on('submit(web-close)', function(data){
            console.log(data.field);
            data.field.type = 'webClose';
            //发异步，把数据提交给php
            $.post('<?php echo U('admin/system/sys_set');?>', {data: data.field}, function(response) {
                if (response.type == 1) {
                    layer.alert(response.info, {icon: 6},function () {
                        window.location.reload();
                    });
                } else if(response.type == 0) {
                    layer.msg(response.info, {icon: 5});
                }
            });
            return false;
          });

          });
    </script>
</body>
</html>